﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using GtsServer.Service.Model;
using GtsServer.Service.Model.Response;
using GtsServer.Common;
using GtsServer.Service.Controller;
using System.ServiceModel.Activation;

namespace GtsServer.Service.IISWcfService
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“Service”。
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class Service : IService
    {
        public BaseResponse<ChanceResponse> GetChance(System.IO.Stream input)
        {
            LogHelper.WriteLog("方法GetChance解析dasdas错误：");
            ChanceResponse response = new ChanceResponse();
            try
            {
                ChanceRequest request = new ChanceRequest();
                ChanceController controller = new ChanceController();

                response = controller.GetChance();

            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("方法GetChance解析错误：", ex);
            }
            BaseResponse<ChanceResponse> baseResponse = new BaseResponse<ChanceResponse>();
            baseResponse.Body = response;
            baseResponse.ClientTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            baseResponse.Command = "GetChance";
            baseResponse.Result = "0";
            return baseResponse;
        }
    }
}
